<?php

namespace IDock\Insurance\CHAC\Request;

use IDock\Http\RequestFormat;
use IDock\Insurance\CHAC\Response\HEPolicyDownloadResponse;
use IDock\Visitor\EPolicyDownloadVisitor;

class HEPolicyDownloadRequest extends AllCHACRequest
{
    protected $route = 'new/vhl/policyElectronic';

    protected $response = HEPolicyDownloadResponse::class;

    protected $urlTip = '保单下载';

    protected $format = RequestFormat::JSON;
    /**
     * @var  EPolicyDownloadVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        return [
            'requestHead' => [
                'requestType' => '',
                'userName' => $this->visitor->argc['userName'] ?? '',
                'passWord' => $this->visitor->argc['passWord'] ?? '',
                'partnerCode' => $this->visitor->argc['partnerCode'] ?? '',
                'queryId' => $this->getRequestId(),
            ],
            'requestBody' => [
                'orderNumber' => $this->visitor->policyNo,
            ]
        ];
    }
}
